package com.springframework.beanLifecycle;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class LifecycleRun {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("com.springframework/beanLifecycle/bean.xml");
        LifecycleBean lifecycleBean = context.getBean("lifecycleBean", LifecycleBean.class);
        System.out.println("6 bean对象创建完成了，可以使用了");
        System.out.println(lifecycleBean);
//        使用ClassPathXmlApplicationContext中的close()方法
        context.close();
    }
}